<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<br />
<c:if test="${not empty param.login_error}">
	<br />
	<div class="alert alert-danger">
  		<fmt:message key="login.unsuccessful"/>: ${SPRING_SECURITY_LAST_EXCEPTION.message}
	</div>	
</c:if>

<c:url value="/login" var="loginUrl"/>
<form action="${loginUrl}" method="post" role="form" class="form-horizontal">
	<fieldset>
		<legend><fmt:message key="login.hint"/></legend>
		
		<div class="form-group">
			<label class="control-label col-sm-2" for="username">
				<fmt:message key="login.user"/>
			</label>
			<div class="col-sm-4"> 
				<input type="text" id="username" name="username" class="form-control" 
  					value='<c:out value="${user}"/>'
  					/>
			</div>
			<div class="col-sm-6"></div>
		</div>
		
		<div class="form-group">
			<label class="control-label col-sm-2" for="password">
				<fmt:message key="login.password"/>
			</label>
			<div class="col-sm-4"> 
				<input type="password" id="password" name="password" class="form-control" />
			</div>
			<div class="col-sm-6"></div>
		</div>
		
		<div class="form-group">
			<div class="col-sm-2">
			</div>
			<div class="col-sm-4 checkbox">
				<label for="receiveNewsletter">
					<input type="checkbox" id="remember-me" name="remember-me" />
					<fmt:message key="login.remember" />
				</label>
			</div>
		</div>
		
		<div class="form-group"> 
    		<div class="col-sm-offset-2 col-sm-10">
				<button type="submit" class="btn btn-default">
					<fmt:message key="login.submit"/>
				</button>
			</div>
		</div>
	</fieldset>
</form>
